#!/bin/bash

#ping -c 2 119.29.29.29 > /dev/null 2>&1
#
#if [ $? -eq 0 ];then
#	echo "网络已连接"
#else
#    echo "正在连接..."
#	python3 auto-network.py
#	echo "连接成功"
#fi

REMOTE_ADDR="223.6.6.6"
ping -c 3 $REMOTE_ADDR # >> /home/nickel/scripts/net.log 2>&1

export TZ=Asia/Shanghai
current_time=$(date +'%Y-%m-%d %H:%M:%S')
#echo $current_time >> /home/nickel/scripts/net.log

# 检查ping命令的退出状态
if [ $? -eq 0 ]; then
   # echo -e "Network is OK.\n" >> /home/nickel/scripts/net.log
else
    python3 /home/nickel/scripts/auto-network.py # >> /home/nickel/scripts/net.log 2>&1
fi


